/**
 * Create by yxk at 2020/6/12
 */
import request from '@/utils/request'

/**
 * 调拨新建/编辑
 */
export function jxcAllocationAddOrUpdateAPI(data, isUpdate = false) {
  return request({
    url: 'jxcAllocation/addOrUpdate' + (isUpdate ? '/update' : '/add'),
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 调拨删除
 */
export function jxcAllocationDeleteByIdsAPI(data) {
  return request({
    url: 'jxcAllocation/deleteByIds',
    method: 'post',
    data: data
  })
}

/**
 * 调拨详情
 */
export function jxcAllocationQueryByIdAPI(data) {
  return request({
    url: `jxcAllocation/queryById/${data.label}`,
    method: 'post',
    data: data
  })
}

/**
 * 调拨作废
 */
export function jxcAllocationSetStateByIdsAPI(data) {
  return request({
    url: 'jxcAllocation/setStateByIds',
    method: 'post',
    data: data
  })
}

/**
 * 查询调拨下的关联产品
 */
export function jxcAllocationQueryChasProductListAPI(data) {
  return request({
    url: 'jxcAllocationProduct/queryChasProductList',
    method: 'post',
    data: data
  })
}

